From: Florian Müllner Date: Mon, 17 Oct 2016 21:05:05 +0000 (+0200) Subject: extensionUtils: Use a unique 'subdir' to create new importers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~678 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d769b72c43acd0297b8ccbe48796f0a316caaed3;p=gnome-shell.git extensionUtils: Use a unique 'subdir' to create new importers Apparently importers for the 'same' path are shared, even when the relative paths resolve to different absolute ones. Until this bug is fixed properly, we can work around this by expressing the current extension path as the UUID relative to the parent directory. https://bugzilla.gnome.org/show_bug.cgi?id=772386 --- diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index 65d02c29a..15438c293 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -151,10 +151,10 @@ function createExtensionObject(uuid, dir, type) { function installImporter(extension) { let oldSearchPath = imports.searchPath.slice(); // make a copy - imports.searchPath = [extension.path]; + imports.searchPath = [extension.dir.get_parent().get_path()]; // importing a "subdir" creates a new importer object that doesn't affect // the global one - extension.imports = imports['.']; + extension.imports = imports[extension.uuid]; imports.searchPath = oldSearchPath; }